thin.define(function(exports) {
	// 删除项目
	exports('submitDeleteProject', function() {
		var _id = $(this).attr('data-proid'),
			iscp = $(this).attr('data-iscp'),
			iscx = $(this).attr('data-iscx');

		var str = '';
		if(iscp == 1) str += '该项目已缴纳评估费，<br/>';
		if(iscx == 1) str += '该项目已缴纳诚信保证金，<br/>';
		str += '是否删除该项目？';

		$.modal({
			title: "提示",
			text: str,
			buttons: [{
				text: "取消",
				className: "default"
			}, {
				text: "确定",
				onClick: function() {
					$.showLoading();
					// 删除项目
					__getdata_prodelete['project_id'] = _id;
					factory.request('_project_delete');
				}
			}]
		});

	});
});

var __getdata_prodelete = {};

// 删除项目回调
function __complete_prodelete(res) {
	$.hideLoading();
	if(res.status == 204) {
		$.toast("项目删除成功", 960);
		setTimeout(function() {
			window.location.reload();
		}, 800);
	} else {
		$.toptip(res.error, 'error');
	}
}